{include file="public/header" /}

<link href="/static/admin/css/layui.css" rel="stylesheet">
<script type="text/javascript" src="/ckplayer/ckplayer.js" charset="UTF-8"></script>

<body class="gray-bg">
<div class="{if $ismobile==0}wrapper wrapper-content{/if} animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>模板颜色</h5>
        </div>
      
        <div {if $ismobile==0}class="ibox-content"{/if}>
                        当前使用颜色：
						<div class="input-group"  style="background-image: linear-gradient(to right , {$yanse.daima},{$yanse.daima1} );height:50px;width:100%;">  
                        
						</div>
            <div class="hr-line-dashed">
          </div>
            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
						
							
                                <th width="6%">模板ID</th>
								
                                <th>模板颜色</th>
							
                               
                                <th width="10%">操作</th>
                            </tr>
                        </thead>
                        <script id="list-template" type="text/html">
                            {{# for(var i=0;i<d.length;i++){  }}
                                <tr class="long-td">
								 
								 
							
                                   <td>{{d[i].id}}</td>
                                 
                                                                  
                                   <td style="background-image: linear-gradient(to right , {{d[i].daima}}, {{d[i].daima1}})"></td>  
							
                                     
                                   
                                    
                                                         
                                    <td>
									 <a href="javascript:;" onclick="moban({{d[i].id}})" class="btn btn-danger btn-xs btn-outline">
                                            使用</a>
                                    </td>
                                </tr>
                            {{# } }}
                        </script>
                        <tbody id="list-content"></tbody>
                    </table>
                    <div id="AjaxPage" style="text-align:right;"></div>
                    <div style="text-align: right;">
                       <span id="allpage"></span>
                    </div>
                </div>
			
        </div>
    </div>
</div>
</div>

<!-- 加载动画 -->
<div class="spiner-example">
    <div class="sk-spinner sk-spinner-three-bounce">
        <div class="sk-bounce1"></div>
        <div class="sk-bounce2"></div>
        <div class="sk-bounce3"></div>
    </div>
</div>


{include file="public/footer" /}








<script type="text/javascript" src="/ckplayer/ckplayer.js" charset="utf-8"></script>


<script type="text/javascript">

function moban(id){
	
	window.location="{:url('siyou/moban')}"+"?id="+id;

}
   
   
 
   
    /**
     * [Ajaxpage laypage分页]
     * @param {[type]} curr [当前页]
     */
    Ajaxpage();

    function Ajaxpage(curr){
        var key=$('#key').val();
        $.getJSON('{:url("siyou/moban")}', {
            page: curr || 1,key:key
        }, function(data){      //data是后台返回过来的JSON数据
			$(".spiner-example").css('display','none'); //数据加载完关闭动画
            if(data==''){
                $("#list-content").html('<td colspan="20" style="padding-top:10px;padding-bottom:10px;font-size:16px;text-align:center">暂无数据</td>');
            }else{
                var tpl = document.getElementById('list-template').innerHTML;
                laytpl(tpl).render(data, function(html){
                    document.getElementById('list-content').innerHTML = html;
                });
               
            }
        });
    }
 

function edit_gongyou(id){
    location.href = './edit/id/'+id+'.html';
}


function del_gongyou(id){
    dashang.confirm(id,'{:url("del")}');
}

function show(id,name) {
var zt = $("#show"+id+"").html();
if(zt=='点击显示'){  
$("#name"+id+"").html(name);
$("#show"+id+"").html('点击隐藏');
}else if(zt=='点击隐藏'){  
$("#name"+id+"").html('****');
$("#show"+id+"").html('点击显示');
}
}

function All(e, itemName){
	var aa = document.getElementsByName(itemName);
	for (var i=0; i<aa.length; i++)
	aa[i].checked = e.checked; 
	}
	function checkdel(delid,formname){
	var flag = false;
	for(i=0;i<delid.length;i++){
	if(delid[i].checked == true){
	flag = true;
	break;
	}
	}
	if(!flag){
	return true;
	}else{
	formname.submit();
	}
}


 $("#plqr").click(function(){
	
	var aa = document.getElementsByName('del_id[]');
	var n=0;
	var ids="";
	for (var i=0; i<aa.length; i++){
		
		if(aa[i].checked == true){
			
			if(n>0){
                ids += ',';
            }

            ids += aa[i].value;
			n++;
		}
		
	}
	
	if(ids==''){
		layer.msg("请选择视频",{icon:0,time:1500,shade: 0.1});
	}else{
		$('#isduoge').val('1');
		$('#recipient-id').val(ids);
		$('#recipient-name').hide();
		$('#myPublic').modal('show')
	}
	
}) 




 $("#plqr_all").click(function(){
	$('#isduoge').val('1');
	$('#recipient-id').val('all');
	$('#recipient-name').hide();
	$('#myPublic').modal('show')
}) 



	
function play(url) {

var index1=url.lastIndexOf(".");
var index2=url.length;
var suffix=url.substring(index1+1,index2);
if(suffix==""||suffix=="m3u8"){

layer.alert('<div id="a1"  style="width:580px;height:360px;"></div>\
', {
skin: 'layui-layer-molv' ,
area: ['620px', '510px'] 
,closeBtn: 0,btn:['关闭'],
title:"视频预览",
}); 

	var videoObject = {
		container: '#a1',//“#”代表容器的ID，“.”或“”代表容器的class
		variable: 'player',//该属性必需设置，值等于下面的new chplayer()的对象
		autoplay:true,//自动播放
		html5m3u8:true,
		video:url//视频地址
	};
	var player=new ckplayer(videoObject);


}else{

layer.alert('<div id="a1"  style="width:580px;height:360px;"></div>\
', {
skin: 'layui-layer-molv' ,
area: ['620px', '510px'] 
,closeBtn: 0,btn:['关闭'],
title:"视频预览",
}); 

var flashvars={
		f:'/ckplayer/m3u8.swf',
		a:url,
		s:4,
		c:0
};
	
	var videoObject = {
		container: '#a1',//“#”代表容器的ID，“.”或“”代表容器的class
		variable: 'player',//该属性必需设置，值等于下面的new chplayer()的对象
		autoplay:true,//自动播放
		video:url//视频地址
	};
	var player=new ckplayer(videoObject);
}
$('.layui-layer').css('top','10%');  
}
{if $ismobile==1}
function read(id){
	
	window.location="{:url('gongyou/read')}"+"?id="+id;

}
{/if}










</script>





</body>
</html>